import {QScrollArea} from 'quasar';

const render=QScrollArea.options.render;
/**
 * @author 唐国雄
 * 扩展quasar的QScrollArea组件
 * 事件----------------------
 * @resize			容器大小,{width:number,height:number}
 * @inner-resize	内容大小,{width:number,height:number}
 */
export default {
	name:'ScrollArea',
	extends:QScrollArea,
	created(){
		const old1=this.__updateContainer;
		this.__updateContainer=(size) => {
			old1(size);
			this.$emit('resize',size);
		};
		const old2=this.__updateScrollSize;
		this.__updateScrollSize=(size) => {
			old2(size);
			this.$emit('inner-resize',size);
		};
	},
	render(h){
		const vnode=render.call(this,h);
		vnode.data.staticClass='lexmis-ScrollArea';
		return vnode;
	}
};
